package com.honey.compilation.sql.ddl;

import com.honey.compilation.sql.SqlKeyWord;
import com.honey.compilation.sql.SqlTable;
import com.honey.core.builder.CharacterBuilder;
import com.honey.core.builder.CharacterBuilderFactory;
import com.honey.core.compiler.CompilationException;

/**
 * 修改表命令: ALERT TABLE 
 * @author Administrator
 *
 */
abstract class AlterTableAddConstraint extends AlterTableAdd {
	
	/**
	 * 构造函数
	 * @param tableName
	 */
	public AlterTableAddConstraint(String tableName) {
		super(tableName);
	}

	/**
	 * 构造函数
	 * @param table 数据库表对象
	 */
	public AlterTableAddConstraint(SqlTable table){
		super(table);
	}
	
	/**
	 * 构造函数
	 * @param tableName
	 */
	public AlterTableAddConstraint(String schema , String tableName) {
		super(schema , tableName);
	}
	
	@Override
	public CharacterBuilder compiledContent(int indentLevel) throws CompilationException {
		CharacterBuilder answer = CharacterBuilderFactory.createC16StringBuilder() ;
		answer.append( super.compiledContent(indentLevel) ) 
		.append( SqlKeyWord.CONSTRAINT );

		return answer ;
	}

}
